package com.dzm.content.controller.web;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dzm.content.entity.Content;
import com.dzm.content.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 作者：Dzm
 * 时间：2024-09-13-21:54
 * 功能：
 */

@Controller
@RequestMapping
public class IndexController {

    @Autowired
    private ContentService contentService;

    @GetMapping(value = {"/", "/index.html"})
    public String index(Model model) {
        List<Content> contentList = contentService.getBanners();

        model.addAttribute("contentList", contentList);
        return "index";
    }

}
